package com.validators;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = ObjectIDValidator.class)
@Documented
public @interface ObjectSelected {
	String message() default "Debe ingresar un valor";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

	/**
	 * Propiedad a validar
	 */
	String property() default "nombre";

	String id() default "id";

	@Target({ ElementType.METHOD, ElementType.FIELD,
			ElementType.ANNOTATION_TYPE })
	@Retention(RUNTIME)
	@Documented
	@interface List {
		ObjectSelected[] value();
	}

}
